package com.xiaobug.demo.permission;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.Log;

import com.ljb.commlibrary.permission.Permission;
import com.ljb.commlibrary.utils.ActivityCollector;
import com.xiaobug.baselibrary.base.BaseSplashActivity;
import com.xiaobug.demo.MainActivity;

import java.util.List;

/**
 * Created by ljb on 2018/4/27.
 */

public class SplashActivity extends BaseSplashActivity {
    @Override
    protected void onRequestPermissionsSucess(List<String> permissions) {
        Log.e(TAG, "onPermissionSucess: "+ TextUtils.join(",",permissions));
        MainActivity.actionStart(this);

    }

    @Override
    protected void onRequestPermissionQuit(List<String> permissions) {
        Log.e(TAG, "onRequestPermissionQuit: "+ TextUtils.join(",",permissions));
        ActivityCollector.finish();
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestPermission(Permission.CAMERA,Permission.READ_CONTACTS,Permission.WRITE_EXTERNAL_STORAGE,Permission.READ_EXTERNAL_STORAGE);
    }
}
